package him.serviceimple;

import java.util.List;

import him.dao.CourseStuDAO;
import him.dto.coursemanage.CoursestuDTO;
import him.service.CourseStuService;

public class CourseStuServiceImple implements CourseStuService {
	private CourseStuDAO courseStuDAO;
	private static CourseStuServiceImple courseStuService;
	
	public static CourseStuServiceImple getInstance(){
		if (courseStuService==null) {
			courseStuService=new CourseStuServiceImple();
		}
		return courseStuService;
	}
	@Override
	public List<CoursestuDTO> getAllCourseStuList(String course_code) {
		return courseStuDAO.getAllCourseStuList(course_code);
	}
	@Override
	public boolean updateCourseStu(String id, String courseCode) {
		boolean isC = courseStuDAO.updateCourseStu(id, courseCode);
		boolean isL = courseStuDAO.updateLogin(id);
		return isC==true&&isL==true? true:false;
	}

}
